<?php
//本代码为体现代码，入口为tixian方法
namespace app\index\controller;
use app\common\controller\Frontend;
use app\common\library\Game;
use think\Lang;
use think\Db;
use think\Controller;
use think\Cache;
/////////////////////////////////////////////////////////////////////华丽的分割线//
class Cash extends Frontend
{

  protected $noNeedLogin = ['getopenid','saveopenid'];
    protected $noNeedRight = ['*'];
    protected $layout = '';
public function _initialize()
    {
     parent::_initialize();
     $auth = $this->auth;
     $this->todaystr=strtotime(date('Ymd'));
     $this->game=new Game($this->view->site,$this->view->user);
    // echo "ff";exit;
    }

  //1.调用付款接口
  public function tixian($fee=0,$openid=''){
    $this->game->cache_set('lock_balance'.$this->auth->id,0);
    $fee=$this->request->param('txmoney');
    //防止卡包
      $map=array();
      $map['msg']='提现申请已提交，请耐心等待客服审核!';

      $lock_balance=$this->game->cache_get('lock_balance'.$this->auth->id);
      if ($lock_balance!=0) {
        $map['msg']='提现申请已提交，请耐心等待客服审核aa';
      }else{
         //启动异步取款
        $qiyue=controller('Qiyue','controller');
        $qiyue->nourl_pay($this->auth->id,$fee,'余额提现：'.$fee,'point');//.$str.$fee
      }
      $nowpoint=db::name('user')->where('id='.$this->auth->id)->value('point');
    $map['code']='ok';//oks
    $map['message']='ok';//oks
    $map['money']=$nowpoint;//oks
    echo json_encode($map);
    return ;
  }
  //2.获取openid
  public function getopenid($uid=0){
   
    return $data;
  }
  //3.保存openid
  public function saveopenid($uid=0,$openid=''){
   
    return $data;
  }
  
/////////////////////////微信自动登录代码结束//////////////////
}

?>